Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jq rule composition - workflow for async getters #642

Merged
merged 15 commits into from
Nov 5, 2024
Merged

Conversation

brendanobra
Copy link
Contributor

What

What does this PR add or remove?

Why

Why are these changes needed?

How

How do these changes achieve the goal?

Test

How has this been tested? How can a reviewer test it?

Checklist

  • I have self-reviewed this PR
  • I have added tests that prove the feature works or the fix is effective

@CLAassistant
Copy link

CLAassistant commented Oct 1, 2024

CLA assistant check
All committers have signed the CLA.

@bsenth200 bsenth200 changed the title WIP: Jq rule composition Jq rule composition Oct 29, 2024
@bsenth200 bsenth200 changed the title Jq rule composition Jq rule composition - workflow for async getters Oct 29, 2024
"alias": "workflow",
"endpoint": "workflow",
"sources": [{
"method": "static.rle"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a typo here for static.rle does it still work is the test for invalid rule?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case (the unit test test RuleEngine::load_from_string_literal, which makinly tests that it can take a schema compliant string as input, and produce a rule engine from them), so it does not make any difference (but does look a little confusing now that i'm looking at it)

@@ -197,6 +198,60 @@ impl JsonRpcApiRequest {
}
}

#[derive(Clone, Default, Debug)]
pub struct JsonRpcApiError {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this added because JsonRPCAPIResponse doesnt have message:String Just curious why we need this new entry?

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct JsonRpcApiResponse {
pub jsonrpc: String,
pub id: Option,
#[serde(skip_serializing_if = "Option::is_none")]
pub result: Option,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option,
#[serde(skip_serializing)]
pub method: Option,
#[serde(skip_serializing)]
pub params: Option,
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (JsonApiError)was added to add stronger typing (as part of my original POC). This will (does) ultimately make code more understandable and enable proper encapsulation, higher type safety and ultimately better maintenance and unit testing in the future.

Copy link

github-actions bot commented Nov 5, 2024

Code Coverage

Package Line Rate Health
device.thunder.src.bootstrap 0%
device.thunder_ripple_sdk.src.processors.events 0%
device.thunder.src 0%
core.launcher.src.manager 7%
core.main.src 0%
device.mock_device.src 52%
core.main.src.state.cap 43%
device.thunder_ripple_sdk.src.events 4%
core.sdk.src.extn.ffi 80%
core.main.src.bootstrap.manifest 0%
core.sdk.src.framework 75%
core.main.src.bootstrap 0%
core.main.src.bootstrap.extn 0%
core.main.src.firebolt.handlers 9%
core.main.src.firebolt 3%
core.sdk.src.api.manifest 91%
device.thunder_ripple_sdk.src.client 74%
core.main.src.state 24%
core.tdk.src.utils 0%
core.sdk.src.api.observability 61%
device.thunder_ripple_sdk.src 15%
core.main.src.service 31%
core.sdk.src.extn.client 91%
core.main.src.broker 53%
core.sdk.src.utils 53%
device.thunder_ripple_sdk.src.bootstrap 0%
distributor.general.src 2%
device.thunder_ripple_sdk.src.processors 9%
core.sdk.src.extn 83%
core.tdk.src.gateway 100%
core.main.src.processor.storage 0%
core.sdk.src.api.device 77%
openrpc_validator.src 75%
core.main.src.processor 0%
core.sdk.src.api 78%
core.sdk.src.api.firebolt 77%
core.main.src.broker.thunder 22%
core.launcher.src 0%
core.main.src.utils 26%
core.main.src.service.apps 47%
core.sdk.src.api.distributor 84%
core.sdk.src.api.gateway 75%
core.main.src.service.extn 40%
Summary 43% (18706 / 43248)

Minimum allowed line rate is 42%

@bsenth200 bsenth200 merged commit 9a9fdde into main Nov 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants